<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>
<script type="text/javascript">
$(function(){
    $('#jquery-accordion').accordion({
        autoHeight: false,
        navigation: true
    });
});
</script>
<form id="playerEditForm" action="<?php echo url_for('player/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
    <div id="jquery-accordion">
        <h3><a href="#jquery-accordion"><?php echo __('Informations de base'); ?></a></h3>
        <div>
            <ul class='formRegister'>
            <?php if ($form->hasGlobalErrors()): ?>
                <?php foreach ($form->getGlobalErrors() as $name => $error): ?>
                    <li class='error'><?php echo $error ?></li>
                <?php endforeach; ?>
            <?php endif; ?>
            <li>
                <label><?php echo __('Username') ?></label>
                <p><?php echo $form->getObject()->getUsername() ?></p>
            </li>

            </ul>
            <ul class="formRegister">
                <?php foreach ($form as $widget): ?>
                <?php if($widget->getName() != 'signature' && $widget->getName() != 'quote' && $widget->getName() != 'avatar') : ?>
                    <?php if (!$widget->isHidden()) { ?>
                        <li>
                            <span>
                                <?php echo $widget->renderLabel(); ?>
                                <?php echo $widget->renderHelp() ?>
                                <?php echo $widget->renderError() ?>
                            </span>
                            <?php echo $widget->render() ?>
                        </li>
                    <?php } else { ?>
                        <li><?php echo $widget->render() ?></li>
                    <?php } ?>
                <?php endif; ?>
                <?php endforeach; ?>
            </ul>
            <input type="submit" class="btn primary" value="<?php echo __('Modifier'); ?>" />
        </div>
         <h3><a href="#jquery-accordion"><?php echo __('Avatar'); ?></a></h3>
        <div>
            <ul class='formRegister'>
            <li>
                <span>
                    <?php echo $form['avatar']->renderLabel(); ?>
                    <?php echo $form['avatar']->renderHelp() ?>
                    <?php echo $form['avatar']->renderError() ?>
                </span>
                <?php echo $form['avatar']->render() ?>
            </li>
        </ul>
        <input type="submit" class="btn primary" value="<?php echo __('Modifier'); ?>" />
     </div>
        <h3><a href="#jquery-accordion"><?php echo __('Signature & Citation'); ?></a></h3>
        <div>
            <ul class='formRegister'>
            <li>
                <span>
                    <?php echo $form['quote']->renderLabel(); ?>
                    <?php echo $form['quote']->renderHelp() ?>
                    <?php echo $form['quote']->renderError() ?>
                </span>
                <?php echo $form['quote']->render() ?>
            </li>
            <li>
                <span>
                    <?php echo $form['signature']->renderLabel(); ?>
                    <?php echo $form['signature']->renderHelp() ?>
                    <?php echo $form['signature']->renderError() ?>
                </span>
                <?php echo $form['signature']->render() ?>
            </li>
        </ul>
        <input type="submit" class="btn primary" value="<?php echo __('Modifier'); ?>" />
     </div>
    </div>

<?php endif; ?>
</form>
